﻿@model HdipCricketClub.ViewModels.SelectedTeamCreatedViewModel

@{
    ViewBag.Title = "ContactPlayers";
}

<h2>Contact Players:</h2>

@using (@Html.BeginForm("ContactPlayers", "SelectTeam", FormMethod.Post))
{
    <fieldset>
    <legend>Fixture:</legend>
    <br />
    @Html.DisplayFor(ModelItem => Model.SelectedFixture.Team.Club.ShortName) @Html.DisplayFor(ModelItem => Model.SelectedFixture.Team.name)
    vs @Html.DisplayFor(ModelItem => Model.SelectedFixture.Opponent.club_name) @Html.DisplayFor(ModelItem => Model.SelectedFixture.Opponent.team_name)<br />
    on @Html.DisplayFor(ModelItem => Model.SelectedFixture.date)
    @Html.HiddenFor(ModelItem => Model.SelectedFixture.fixture_id)
    <br />
    </fieldset>
    <br />
    <fieldset>
    <legend>Team Selected:</legend>
    <br />
        <table>
            <tr>
                <th>
                    Name:
                </th>
                <th>
                    Contact:
                </th>
                <th>
                    Confirmed:
                </th>
            </tr>
        @foreach (var item in Model.TeamCreated)
        {
            <tr>
                    @Html.HiddenFor(modelItem => item.fixture_id)
                    @Html.HiddenFor(modelItem => item.player_id)
                <td>
                    @Html.DisplayFor(modelItem => item.Member.FirstAndLastName)
                </td>
                <td class="contact-player">
                    @Html.EditorFor(modelItem => item.contact)
                </td>
                <td class="contact-player">
                    @Html.EditorFor(modelItem => item.confirmed)
                </td>
            </tr>
        }
    </table>
    </fieldset>
    <p>
        <input type="submit" value="Contact" />  |
        @Html.ActionLink("Return to Home Page", "Index", "Home")  |
    </p>
}